package zack.project.domain.strategy.service;

import zack.project.domain.strategy.model.valobj.StrategyAwardStockKeyVO;

/**抽奖奖品库存接口
 * @author A1793
 */
public interface IRaffleStock {

    /**
     * 从redis根据cacheKey来获取延迟队列,并从队列中获取对应的StrategyAwardStockKeyVO(strategyId,awardId)
     * @return
     */
    StrategyAwardStockKeyVO takeQueueValue();

    /**
     * 根据takeQueueValue()方法获得的StrategyAwardStockKeyVO(strategyId,awardId),去更新数据库表{strategy_award}的库存信息
     * @param strategyId
     * @param awardId
     */
    void updateStrategyAwardStock(Long strategyId, Integer awardId);
}
